const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
    
    mode:'development',
    entry:path.join(__dirname,'./src/index.js'),
    output:{
        filename:'main.js',
        path:path.join(__dirname,'./dist')
    },
    module:{
        rules:[
            {
                test:/\.css/,
                use:['style-loader','css-loader']
            },
            {
                test:/\.(jpg)|(png)|(gif)/,
                use:['file-loader']
            },
            {
                test:/\.vue/,
                use:['vue-loader']
            }
        ]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./public/index.html'
        }),
        new VueLoaderPlugin()
    ],
    resolve:{
        alias:{
        "vue$":"vue/dist/vue.esm.js",
        "@":path.join(__dirname,'./src')
        }
    },
    devServer:{
        port:8080,
        host:'0.0.0.0',
        quiet:true
    }
}